<?php
/*
 *  @author Nicolas Genevaux
 * (c)nige 2008
 */
	include_once($RACINE.'inc/fct.utils.php');
	include_once($RACINE.'inc/fct.basedonnee.php');
	include_once($RACINE.'inc/var.pages.php');
	include($RACINE.'inc/sql.exercice.php');
	include($RACINE.'inc/sql.exercicechoix.php');
	if($_POST['suivant']) {
		redirect($PAGE_DETAIL_QUESTION.'?idmat='.$_POST['idmat'].'&rang='.($_POST['rang']+1));
	}
	else if($_POST['precedent']) {
		redirect($PAGE_DETAIL_QUESTION.'?idmat='.$_POST['idmat'].'&rang='.($_POST['rang']-1));
	}
	else if($_POST['supprimer']) {
		redirect($PAGE_SUPPRI_QUESTION.'?idmat='.$_POST['idmat'].'&idex='.$_POST['identifiantexercice']);
	}
	else if($_POST['modifier']) {
		redirect($PAGE_MODIFI_QUESTION.'?idmat='.$_POST['idmat'].'&idex='.$_POST['identifiantexercice']);
	}
	else if($_POST['vmodifier']) {
		$total = doSQL($EXERCICE_SELECT_INMAEX,array(0=>$_POST['idquestion'],1=>$_POST['idmat'],2=>$_SESSION['ID_CONECT']));
		if($total['total']==1) {
			doSQL($EXERCICE_UPDATE,array(0=>"'".$_POST['question']."'",1=>"'".$_POST['idquestion']."'"));
			doSQL($EXERCICECHOIX_UPDELE,array(0=>"'".$_POST['reponse']."'",1=>"'".$_POST['idquestion']."'"));
			doSQL($EXERCICECHOIX_UPDATE,array(0=>"'".$_POST['reponse']."'",1=>"'".$_POST['idreponse']."'"));
		}
		redirect($PAGE_LISTE_QUESTION);
	}
?>
